package main

import (
	enc "encoding/ascii85"
	"encoding/binary"
	"fmt"
	"log"
)

func main() {
	TestAgKey()
	// Generate a new SM2 private key
	// privateKey, err := sm2.GenerateKey(rand.Reader)
	// if err != nil {
	// 	fmt.Println("Error generating private key:", err)
	// 	return
	// }

	// // Get the corresponding public key
	// publicKey := &privateKey.PublicKey

	// // Message to be signed
	// message := []byte("Hello, World!")

	// // Sign the message
	// signature, err := privateKey.Sign(rand.Reader, message, nil)
	// if err != nil {
	// 	fmt.Println("Error signing message:", err)
	// 	return
	// }

	// fmt.Printf("Signature: %s\n", hex.EncodeToString(signature))

	// // Verify the signature
	// valid := publicKey.Verify(message, signature)
	// if valid {
	// 	fmt.Println("The signature is valid.")
	// } else {
	// 	fmt.Println("The signature is invalid.")
	// }
}
func int32ToBytes(i int32) []byte {
	buf := make([]byte, 4)
	binary.BigEndian.PutUint32(buf, uint32(i))
	return buf
}
func TestAgKey() {
	// src := []byte{01, 23, 45, 66, 11, 23, 45, 67, 78, 90, 80, 12, 13, 43}
	str := "who are you , iasfsafdsajfsaljflsaf )"
	src := []byte(str)
	dst := make([]byte, (len(str)+3)/4*5)

	enc.Encode(dst, src)

	log.Printf("gk \n %v\n %v ", str, string(dst))

	//start := 90099992312
	// start := 0
	// for i := range 1 {
	{
		i := 4000000000
		//src := int32ToBytes(int32(00))
		src := fmt.Sprint(int32(i))
		dst := make([]byte, enc.MaxEncodedLen(len(src)))
		enc.Encode(dst, []byte(src))
		// log.Printf("num %v", string(dst))

		log.Printf("num %v %v", i, string(dst))
	}
	// }

}
